using System;
using System.Collections.Generic;
using System.ByteBuffer;
using tools;

namespace Zjh
{
    /// <summary>
    /// generate by msg tool
    /// 炸金花玩家总结算信息
    /// </summary>
	public class PlayerBillInfo : Dto
	{
		//玩家id
		public long playerId;
		//微信昵称
		public String nickName;
		//结算筹码(包含喜钱)
		public long cedit;
		//豹子次数
		public int baoZiNum;
		//同花顺次数
		public int tongHuaShunNum;
		//金花次数
		public int jinHuaNum;
		//顺子次数
		public int shunZiNum;
		//对子次数
		public int duiZiNum;

        public PlayerBillInfo() { }

        public PlayerBillInfo(long playerId, String nickName, long cedit, int baoZiNum, int tongHuaShunNum, int jinHuaNum, int shunZiNum, int duiZiNum)
        {
            this.playerId = playerId;
            this.nickName = nickName;
            this.cedit = cedit;
            this.baoZiNum = baoZiNum;
            this.tongHuaShunNum = tongHuaShunNum;
            this.jinHuaNum = jinHuaNum;
            this.shunZiNum = shunZiNum;
            this.duiZiNum = duiZiNum;
        }

        
		public void write(object obj)
		{
			ByteBuffer b = obj as ByteBuffer;
			b.PushLong(playerId);
			b.PushString(nickName);
			b.PushLong(cedit);
			b.PushInt(baoZiNum);
			b.PushInt(tongHuaShunNum);
			b.PushInt(jinHuaNum);
			b.PushInt(shunZiNum);
			b.PushInt(duiZiNum);
			
		}

	    public void read(object obj)
		{
		    MyConverter b = obj as MyConverter;
			playerId = b.toInt64();
			nickName = b.toString();
			cedit = b.toInt64();
			baoZiNum = b.toInt32();
			tongHuaShunNum = b.toInt32();
			jinHuaNum = b.toInt32();
			shunZiNum = b.toInt32();
			duiZiNum = b.toInt32();
			
		}

	}
}